﻿<%@ Page Language="VB" MasterPageFile="~/promocionVenta.master" AutoEventWireup="false"
CodeFile="consultaProformas.aspx.vb" Inherits="Reportes_Proformas" Title=" .:: EVOLTA | Promoción ::. " %>

<%@ MasterType VirtualPath="~/promocionVenta.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register Assembly="Flan.Controls" Namespace="Flan.Controls" TagPrefix="flan" %>
<%@ Register Assembly="ExtGridView" Namespace="ExGridView" TagPrefix="exGV" %>
<%@ OutputCache Duration="15" VaryByParam="none" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
.filaEncabezadoPrincipal
{
background-image: url('../imagenes/px_td.jpg');
width: 100%;
background-repeat: repeat;
}
.filaEncabezadoTitulo
{
background-image: url('../imagenes/submenu3.PNG');
background-repeat: repeat;
}
.filaEncabezado
{
background-image: url('../imagenes/submenu3.PNG');
width: 100%;
background-repeat: repeat;
}
.colGrilla
{
background-image: url('../imagenes/submenu2.PNG');
background-repeat: repeat;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<table style="width: 100%; background-color: #f4f4f4;" cellspacing="0">
<tr class="filaEncabezadoPrincipal">
<td>
<table width="100%">
<tr>
<td><asp:Label ID="Label5" runat="server" CssClass="CeldaTituloTexto" Text="Reporte Proformas"> </asp:Label></td>
</tr>
</table>
</td>
</tr>
</table>
<asp:Panel ID="pnlProformas" runat="server" Width="100%">
<table style="width: 100%; background-color: #f4f4f4" class="EditarLabel" cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td class="filaEncabezado"><asp:Label ID="Label90" runat="server" Text="Búsqueda " Font-Bold="True" SkinID="lblSubTituloTexto"></asp:Label></td></tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td align="right"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td align="right">&nbsp;&nbsp;</td>
<td align="right"></td>
<td>&nbsp;</td>
<td></td>
<td width="10">&nbsp;</td>
<td width="10"></td>
<td width="10"></td>
<td width="10"></td>
</tr>
<tr>
<td align="right"><asp:Label ID="Label91" runat="server" Text="Vendedor :" SkinID="lblNormal"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upVendedor" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<select id="selVendedor" name="D1" runat="server" class="CssddlNormal"><option></option></select>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td align="right">&nbsp;</td>
<td align="right"><asp:Label ID="Label2" runat="server" Text="Forma de Contacto :" SkinID="lblNormal"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upFormaContacto" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<select id="selFormaContacto" name="D1" runat="server" class="CssddlNormal"><option></option></select>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
</tr>
<tr>
<td align="right"><asp:Label ID="Label6" runat="server" SkinID="lblNormal" Text="Nivel de Interes :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upNivelInteres" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<select id="selNivelInteres" runat="server" class="CssddlNormal" name="selNivelInteres" tabindex="1"><option></option></select>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td align="right">&nbsp;</td>
<td align="right"><asp:Label ID="Label27" runat="server" SkinID="lblNormal" TabIndex="2" Text="Como se Enteró :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upComoSeEntero" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<select id="selComoSeEntero" runat="server" class="CssddlNormal" name="selComoSeEntero" tabindex="3"><option></option></select>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td width="10">&nbsp;</td>
<td width="10"><asp:Button ID="btnBuscar" runat="server" OnClientClick="return validar();" SkinID="btnNormalSkin" Text="Buscar" /></td>
<td width="10"><asp:Button ID="btnLimpiar" runat="server" Text="Limpiar" SkinID="btnNormalSkin" /></td>
<td width="10"><asp:Button ID="btnExportar" runat="server" Text="Exportar" SkinID="btnNormalSkin" /></td>
</tr>
<tr>
<td align="right"><asp:Label ID="Label95" runat="server" SkinID="lblNormal" Text="Departamento :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upDepartamento" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="ddlDepartamento" runat="server" AutoPostBack="True" SkinID="ddlNormalObligatorioSkin"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td align="right">&nbsp;</td>
<td align="right"><asp:Label ID="Label96" runat="server" SkinID="lblNormal" Text="Provincia :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upProvincia" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="ddlProvincia" runat="server" AutoPostBack="True" SkinID="ddlNormalObligatorioSkin"></asp:DropDownList>
</ContentTemplate>
<Triggers><asp:AsyncPostBackTrigger ControlID="ddlDepartamento" EventName="SelectedIndexChanged" /></Triggers>
</asp:UpdatePanel>
</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
</tr>
<tr>
<td align="right"><asp:Label ID="Label92" runat="server" SkinID="lblNormal" Text="Distritos :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upDistrito" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<select id="selDistrito" runat="server" class="CssddlNormalObligatorio" name="D2"><option></option></select>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlDepartamento" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="ddlProvincia" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
<td align="right">&nbsp;</td>
<td align="right"><asp:Label ID="Label93" runat="server" SkinID="lblNormal" Text="Modelos de Inmueble :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upModeloInmueble" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<select id="selModeloInmueble" runat="server" class="CssddlNormal" name="D3"><option></option></select>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
<td width="10">&nbsp;</td>
</tr>
<tr>
<td align="right"><asp:Label ID="Label1" runat="server" SkinID="lblNormal" TabIndex="4" Text="Rango Fecha Inicial :"></asp:Label></td>
<td></td>
<td>
<asp:UpdatePanel ID="upFchInicio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="txtFchInicio" runat="server" SkinID="txtNormalObligatorioSkin" TabIndex="5"></asp:TextBox>
<asp:ImageButton ID="imgFchInicio" runat="server" ImageUrl="~/imagenes/Procesos/calendario.png" TabIndex="6" />
<ajax:MaskedEditExtender ID="MExtFchInicio" runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
Mask="99/99/9999" MaskType="Date" TargetControlID="txtFchInicio" UserDateFormat="DayMonthYear">
</ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CExtFchInicio" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgFchInicio" TargetControlID="txtFchInicio"></ajax:CalendarExtender>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td align="right">&nbsp;</td>
<td align="right"><asp:Label ID="Label3" runat="server" SkinID="lblNormal" TabIndex="7" Text="Rango Fecha Final :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upFchFin" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="txtFchFin" runat="server" SkinID="txtNormalObligatorioSkin" TabIndex="8"></asp:TextBox>
<asp:ImageButton ID="imgFchFin" runat="server" ImageUrl="~/imagenes/Procesos/calendario.png" TabIndex="9" Width="16px" />
<ajax:MaskedEditExtender ID="MExtFchFin" runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
Mask="99/99/9999" MaskType="Date" TargetControlID="txtFchFin" UserDateFormat="DayMonthYear">
</ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CExtFchFin" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgFchFin" TargetControlID="txtFchFin"></ajax:CalendarExtender>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>&nbsp;</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td align="right"><asp:Label ID="Label94" runat="server" Text="Posible Cliente :" SkinID="lblNormal"></asp:Label></td>
<td></td>
<td colspan="5">
<asp:UpdatePanel ID="upPosCliente" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<input id="txtPosCliente" runat="server" autocomplete="off" type="text" class="CsstxtNormal" style="width: 470px" onkeypress="return validarSoloLetras(event);" maxlength="55" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right"><asp:Label ID="Label7" runat="server" SkinID="lblNormal" Text="Perfil Crediticio :"></asp:Label></td>
<td>&nbsp;</td>
<td>
<asp:UpdatePanel ID="upPerfilCrediticio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<select id="selPerfilCrediticio" runat="server" class="CssddlNormal" name="D3"><option></option></select>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td align="right">&nbsp;</td>
<td align="right">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;&nbsp;</td>
<td align="right">&nbsp;</td>
<td align="right">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="width: 100%">
<tbody>
<tr>
<td class="filaEncabezado"><asp:Label ID="Label4" runat="server" Text="Resultado de Búsquedas" Font-Bold="True" SkinID="lblSubTituloTexto"></asp:Label></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td>
<!--<div id="divMostrar" runat="server" style="height:250px;">-->
<!--EXTGRIDVIEW-->
<%--<div style="width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; border: solid 1px #999999;
margin: 1px 1px 1px 1px;">
<div style="width: 142%; height: 600px;">--%>
<asp:UpdatePanel ID="upnSeparacionVenta" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="Div2" class="DivPanelGrilla" runat="server">
<exGV:ExtGridView ID="egvProforma" runat="server" CssClass="EditarGridView" ForeColor="Black" Width="100%" AutoGenerateColumns="False" DataKeyNames="idProforma" CellPadding="3" ExpandButtonText="<img src='../Imagenes/Tree/expand.png' alt='Expandir' border='0' />" CollapseButtonText="<img src='../Imagenes/Tree/collapse.png' alt='Comprimir' border='0'/>" EnableViewState="False" AllowPaging="True" EnableSortingAndPagingCallbacks="True" PageSize="17">
<Columns>
<asp:TemplateField HeaderText="Obs.">
<ItemTemplate>
<asp:ImageButton ID="imgObs" runat="server" ImageUrl="../imagenes/Procesos/information.png" style="cursor:pointer;" AlternateText="" />
<ajax:PopupControlExtender ID="pceObs" runat="server" TargetControlID="imgObs" Position="Right" PopupControlID="pnlObs">
</ajax:PopupControlExtender>
<asp:Panel ID="pnlObs" runat="server" style="display:none; background-color:#FFFFCC; font-size:11px; border:solid 1px Black;">
<table style="width:500px;" >
<tbody align='left'>
<tr><td rowspan='2'>&nbsp;&nbsp;</td>
<td><b>Observación: </b><%# Eval("observacion") %>
</td>
</tbody>
</table>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="correlativo" HeaderText="N°"><ItemStyle HorizontalAlign="Center" Width="2%" Height="20px"></ItemStyle></asp:BoundField>
<%--<asp:BoundField DataField="descProyecto" HeaderText="Proyecto"><ItemStyle HorizontalAlign="Left" Width="5%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="descEtapa" HeaderText="Etapa"><ItemStyle HorizontalAlign="Left" Width="5%" Height="20px"></ItemStyle></asp:BoundField>--%>
<asp:BoundField DataField="idProforma" HeaderText="N°Proforma"><ItemStyle HorizontalAlign="Center" Width="5%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="hrCreacion" HeaderText="Hora" DataFormatString="{0:hh:mm:ss tt}"><ItemStyle HorizontalAlign="Center" Width="4%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="fchCreacion" HeaderText="Fecha"><ItemStyle HorizontalAlign="Center" Width="4%" Height="20px"></ItemStyle></asp:BoundField>
<%--<asp:BoundField DataField="nombreCompletosPosCliente" HeaderText="Nombres"><ItemStyle HorizontalAlign="Left" Width="13%" Height="20px"></ItemStyle></asp:BoundField>--%>
<asp:TemplateField HeaderText="Nombres">
<ItemTemplate>
<%#Eval("nombreCompletosPosCliente")%><br /><b>DNI: </b><%# Eval("nroDocumento")%>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="distrito" HeaderText="Distrito"><ItemStyle HorizontalAlign="Left" Width="7%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="rangoEdadPosCliente" HeaderText="R. Edad"><ItemStyle HorizontalAlign="Center" Width="4%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="TelefonosPosCliente" HeaderText="Teléfonos"><ItemStyle HorizontalAlign="Left" Width="6%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="totalIngreso" HeaderText="T. Ingreso" DataFormatString="{0:#,###,##0.00}"><ItemStyle HorizontalAlign="Right" Width="5%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="nombreCompletosVendedor" HeaderText="Vendedor"><ItemStyle HorizontalAlign="Left" Width="13%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="descNivelInteres" HeaderText="N. Interés"><ItemStyle HorizontalAlign="Center" Width="5%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="descComoseEntero" HeaderText="Como se Enteró"><ItemStyle HorizontalAlign="Left" Width="7%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="descFormaContacto" HeaderText="Forma de Contacto"><ItemStyle HorizontalAlign="Left" Width="8%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="descPerfilCrediticio" HeaderText="Perfil Crediticio"><ItemStyle HorizontalAlign="Left" Width="7%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="totalMontoFinal" HeaderText="T. Proforma" DataFormatString="{0:#,###,##0.00}"><ItemStyle HorizontalAlign="Right" Width="5%" Height="20px"></ItemStyle></asp:BoundField>
<%--<asp:BoundField DataField="observacion" HeaderText="Observación"><ItemStyle HorizontalAlign="Left" Width="28%" Height="20px"></ItemStyle></asp:BoundField>--%>
<asp:TemplateField>
<ItemTemplate>
<div id="Div3" class="DivPanelGrilla" style="width: 100%;">
<exGV:ExtGridView ID="egvDetalleProforma" runat="server" CssClass="EditarGridView" Width="100%" EnableViewState="False" CollapseButtonText="<img src='../Imagenes/Tree/collapse.png' alt='Comprimir' border='0'/>" ExpandButtonText="<img src='../Imagenes/Tree/expand.png' alt='Expandir' border='0'/>" CellPadding="3" DataKeyNames="idProforma" AutoGenerateColumns="False" ForeColor="Black">
<Columns>
<asp:BoundField DataField="idProforma" Visible="false"></asp:BoundField>
<asp:BoundField DataField="idProformaDetalle" Visible="false"></asp:BoundField>
<asp:BoundField DataField="descEdificio" HeaderText="Edificio" HtmlEncode="False"><ItemStyle HorizontalAlign="Center" Width="13%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="nomModelo" HeaderText="Modelo" HtmlEncode="False"><ItemStyle HorizontalAlign="Center" Width="13%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="descTpoInmueble" HeaderText="Descripción Inmueble" HtmlEncode="False"><ItemStyle HorizontalAlign="Center" Width="13%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="nroInmueble" HeaderText="Nº Inmueble"><ItemStyle HorizontalAlign="Center" Width="13%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="monto" HeaderText="Precio" DataFormatString="{0:#,###,##0.00}"><ItemStyle HorizontalAlign="Center" Width="11%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="dscto" HeaderText="Descuento" DataFormatString="{0:#,###,##0.00}"><ItemStyle HorizontalAlign="Center" Width="11%" Height="20px"></ItemStyle></asp:BoundField>
<asp:BoundField DataField="montoFinal" HeaderText="Monto Final" DataFormatString="{0:#,###,##0.00}"><ItemStyle HorizontalAlign="Center" Width="11%" Height="20px"></ItemStyle></asp:BoundField>
</Columns>
<RowStyle CssClass="RowStyleGridView" />
<PagerStyle CssClass="PagerStyleGridView" />
<HeaderStyle CssClass="colGrilla" HorizontalAlign="Center" />
<AlternatingRowStyle CssClass="AlternatingRowStyleGridView" />
</exGV:ExtGridView>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="RowStyleGridView" />
<PagerStyle CssClass="PagerStyleGridView" HorizontalAlign="Center" />
<HeaderStyle CssClass="colGrilla" HorizontalAlign="Center" />
<AlternatingRowStyle CssClass="AlternatingRowStyleGridView" />
</exGV:ExtGridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- </div>
</div>--%>
<!--</div> -->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 30%" cellpadding="0" cellspacing="0">
<tr>
<td width="1">&nbsp;</td>
<td>&nbsp;&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="1"></td>
<td width="177px"><asp:Label ID="Label29" runat="server" SkinID="lblNormalNegrita" Text="Monto Total de Proformas"></asp:Label></td>
<td><asp:Label ID="lblTotalIngresosSeparación" runat="server" SkinID="lblNormal">: 0.00</asp:Label></td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td>&nbsp;&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</asp:Panel>
<script language="javascript" type="text/javascript">
function validar() {
if ($get('<%= txtFchInicio.ClientID%>').value == '') {
alert('Debe ingresar una fecha de inicio.');
$get('<%= txtFchInicio.ClientID%>').focus();
return (false);
}
if ($get('<%= txtFchFin.ClientID%>').value == '') {
alert('Debe ingresar una fecha de fin.');
$get('<%= txtFchFin.ClientID%>').focus();
return (false);
}
}
</script>
</asp:Content>